FROM mysql:5.7

LABEL author="baihongru"

# 时区设置
# 操作系统时区
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone

ENV MYSQL_DATABASE=ry-vue

COPY ./sql/*.sql /docker-entrypoint-initdb.d/

# 配置 MySQL 日志时区为 SYSTEM 后才能应用系统时区
COPY ./conf/my.cnf /etc/my.cnf

CMD ["mysqld", \
  "--innodb-buffer-pool-size=80M", \
  "--character-set-server=utf8mb4", \
  "--collation-server=utf8mb4_unicode_ci", \
  "--default-time-zone=+8:00", \
  "--lower-case-table-names=1"]
